package com.thinkgem.jeesite.modules.bookset.service;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.bookset.dao.BkPlaceDao;
import com.thinkgem.jeesite.modules.bookset.entity.BkPlace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 流程模型相关Controller
 *
 * @author ThinkGem
 * @version 2013-11-03
 */
@Service
@Transactional(readOnly = true)
public class BookPlaceService extends CrudService<BkPlaceDao, BkPlace> {

    @Autowired
    private BkPlaceDao bkPlaceDao;


//    @Transactional(readOnly = false)
//    public BkPlace get(String id){
//       return bkPlaceDao.get(id);
//    }

    /**
     * 获取所有馆藏和书库信息
     */
    public Page<BkPlace> getAll(Page<BkPlace> page, BkPlace bkPlace) {
        bkPlace.setPage(page);
        page.setList(bkPlaceDao.findList(bkPlace));
        return page;
    }

    @Transactional(readOnly = false)
    public void batchedit(BkPlace bkPlace){
        bkPlaceDao.batchedit(bkPlace);
    }
}